package com.testfileupload.uploadimg.design.memorandum.more;

public class Client {
    public static void main(String[] args) {
        //定义发起人
        Originator originator = new Originator();
        //定义备忘录管理员
        CareTaker careTaker = new CareTaker();
        //初始化
        originator.setState1("中国");
        originator.setState2("强盛");
        originator.setState3("繁荣");
        System.out.println("初始化状态=="+originator);

        //创建一个备忘录
        careTaker.setMemento(originator.createMemento());
        //修改状态值
        originator.setState1("软件");
        originator.setState1("架构");
        originator.setState1("优秀");
        System.out.println("修改后的状态=="+originator);

        //恢复一个备忘录
        originator.restoreMemento(careTaker.getMemento());

        System.out.println("恢复后的状态===="+originator);
    }
}
